package com.ruoyi.detection.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.utils.Threads;
import com.ruoyi.detection.service.ModelService;
import com.ruoyi.topInsectImg.domain.WebFrontEnd;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.concurrent.ExecutionException;


@Slf4j
@RestController
@RequestMapping("/test")
public class test extends BaseController {

    @Autowired
    private ModelService modelService;

    @PostMapping("/1")
    public void test() throws ExecutionException, InterruptedException {
        try{
            ResponseEntity<String> responseEntity = Threads.detectionRequest("D:\\0.服务器文件\\IMG2012_871.jpg",
                    "http://192.168.1.217:8008/yaoteam/commodityAdd/");
            log.info("responseEntity------->" + responseEntity);
        } catch (Exception e){
            System.out.println(e);
        }
    }

    @PostMapping("/2")
    public void test2(){
        WebFrontEnd frontEnd = new WebFrontEnd();
        frontEnd.setImageName("170471_21-04-01-05-45-58_1.jpg");
        frontEnd.setResUrl("test");
        modelService.updateWebFrontEnd(frontEnd);
    }





}
